package com.fengye.aop.demo.event.listener;

import com.fengye.aop.demo.event.WfStartEvent;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import org.springframework.transaction.event.TransactionPhase;
import org.springframework.transaction.event.TransactionalEventListener;

/**
 * @author fengyexjtu@126.com
 * @since 2022-09-25
 */
@Component
@Slf4j
public class WorkFlowEventListener {
    
    @TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT, classes = WfStartEvent.class)
    public void startEventLister(WfStartEvent wfStartEvent){
        log.info("startEvent = {}", wfStartEvent);
    }
}
